﻿<Window
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:SkladLib="clr-namespace:SkladLib;assembly=SkladLib"
        x:Class="AddUserLib.AddUserWin"
        Title="Nová zakázka" Width="777" Loaded="Window_Loaded_1" Height="617.875" WindowStartupLocation="CenterScreen" Closing="Window_Closing_1" PreviewTextInput="Window_PreviewTextInput_1">
    <Window.Resources>

        <Style TargetType="{x:Type TextBox}">
            <Setter Property="VerticalAlignment" Value="Center" />
            <Setter Property="Margin" Value="0,2,40,2" />
            <Setter Property="Validation.ErrorTemplate">
                <Setter.Value>
                    <ControlTemplate>
                        <DockPanel LastChildFill="true">
                            <Border Background="OrangeRed" DockPanel.Dock="right" Margin="5,0,0,0" 
                        		Width="20" Height="20" CornerRadius="5"
                        		ToolTip="{Binding AdornedElement.(Validation.Errors)[0].ErrorContent, ElementName=customAdorner}">
                                <TextBlock Text="!" VerticalAlignment="center" HorizontalAlignment="center" 
                        			FontWeight="Bold" Foreground="white" />
                            </Border>
                            <AdornedElementPlaceholder x:Name="customAdorner" VerticalAlignment="Center" >
                                <Border BorderBrush="red" BorderThickness="1" />
                            </AdornedElementPlaceholder>
                        </DockPanel>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>

    </Window.Resources>
    <Window.Background>
        <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
            <GradientStop Color="Black" Offset="0"/>
            <GradientStop Color="White" Offset="1"/>
        </LinearGradientBrush>
    </Window.Background>
    <Grid x:Name="grid_1" Margin="0,0,2,55">
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="3*"/>
            <ColumnDefinition Width="898*"/>
        </Grid.ColumnDefinitions>
        <Grid.Background>
            <LinearGradientBrush EndPoint="0.5,1" MappingMode="RelativeToBoundingBox" StartPoint="0.5,0">
                <GradientStop Color="#FFF9F9F9"/>
                <GradientStop Color="#FFC9C9C9" Offset="1"/>
                <GradientStop Color="White" Offset="0.967"/>
            </LinearGradientBrush>
        </Grid.Background>
        <GroupBox Grid.Column="1" Header="Nový zákazník" HorizontalAlignment="Left" Margin="85,22,0,0" VerticalAlignment="Top" Height="137" Width="651" Foreground="#FF226E91" FontWeight="Bold" FontSize="14"/>
        <Label Content="Jméno:" HorizontalAlignment="Left" Margin="423,37,0,0" VerticalAlignment="Top" Grid.Column="1"/>
        <Label Content="Příjmení:" HorizontalAlignment="Left" Margin="414,66,0,0" VerticalAlignment="Top" Grid.Column="1"/>
        <TextBox x:Name="tb_Jmeno" HorizontalAlignment="Left" Height="23" Margin="475,38,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="148" TabIndex="2" Grid.Column="1" 
			Validation.Error="Validation_Error" Text="{Binding Jmeno, NotifyOnValidationError=True, UpdateSourceTrigger=PropertyChanged, ValidatesOnDataErrors=True}"/>
        <TextBox x:Name="tb_Prijmeni" HorizontalAlignment="Left" Height="23" Margin="475,66,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="148" TabIndex="3" Grid.Column="1"
			Validation.Error="Validation_Error" Text="{Binding Prijmeni, NotifyOnValidationError=True, UpdateSourceTrigger=PropertyChanged, ValidatesOnDataErrors=True}"/>
        <Label Content="Číslo OP:" HorizontalAlignment="Left" Margin="414,92,0,0" VerticalAlignment="Top" Grid.Column="1"/>
        <TextBox x:Name="tb_OP" HorizontalAlignment="Left" Height="23" Margin="475,94,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="149" TabIndex="4" Grid.Column="1"/>
        <Label Content="Číslo karty:" HorizontalAlignment="Left" Margin="148,38,0,0" VerticalAlignment="Top" Grid.Column="1"/>
        <TextBox x:Name="tb_cisloKarty" HorizontalAlignment="Left" Height="23" Margin="220,38,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="112" TextChanged="tb_cisloKarty_TextChanged" FontWeight="Bold" FontStyle="Italic" TabIndex="1" Grid.Column="1"/>
        <Button x:Name="bt_SmazatCisloKarty" Content="Smazat" HorizontalAlignment="Left" Margin="337,38,0,0" VerticalAlignment="Top" Width="48" Click="bt_SmazatCisloKarty_Click" TabIndex="100" RenderTransformOrigin="0.583,0.55" Grid.Column="1" Height="23"/>

        <ListView x:Name="list_SeznamZbozi" HorizontalAlignment="Left" Height="245" Margin="27,210,0,0" VerticalAlignment="Top" Width="709" SelectionMode="Single" Grid.Column="1" SelectionChanged="list_SeznamZbozi_SelectionChanged">
            <ListView.View>
                <GridView>
                    <GridViewColumn Width="80" Header="Kód" DisplayMemberBinding="{Binding CarovyKod}"/>
                    <GridViewColumn Width="80" Header="Název" DisplayMemberBinding="{Binding Nazev}"/>
                    <GridViewColumn Width="100" Header="Popis" DisplayMemberBinding="{Binding Prefix}"/>
                    <GridViewColumn Width="110" Header="Datum půjčení" DisplayMemberBinding="{Binding OdDne, StringFormat=dd-MM-yyyy}"/>
                    <GridViewColumn Width="60" Header="Na dobu" DisplayMemberBinding="{Binding PocetDni}"/>
                    <GridViewColumn Width="60" Header="Rezerva" DisplayMemberBinding="{Binding Rezerva}"/>
                    <GridViewColumn Width="90" Header="Datum vrácení" DisplayMemberBinding="{Binding KeDni, StringFormat=dd-MM-yyyy}"/>
                    <GridViewColumn Width="110" Header="Cena" DisplayMemberBinding="{Binding Cena}"/>
                </GridView>
            </ListView.View>
        </ListView>

        <Button x:Name="bt_OK" Content="Potvrdit" HorizontalAlignment="Left" Margin="542,538,0,-60" VerticalAlignment="Top" Width="104" RenderTransformOrigin="1.107,-1.65" Click="bt_OK_Click" FontSize="16" FontWeight="Bold" Grid.Column="1" TabIndex="6" Height="37"/>
        <Button x:Name="bt_Storno" Content="Storno" HorizontalAlignment="Left" Margin="663,538,0,-60" VerticalAlignment="Top" Width="75" Click="bt_Storno_Click" FontSize="16" Grid.Column="1" TabIndex="7" Height="37"/>

        <GroupBox HorizontalAlignment="Left" Margin="449,470,0,0" VerticalAlignment="Top" Height="52" Width="289" BorderBrush="{x:Null}" Background="#FFDECD5D" Grid.Column="1">
            <Label Content="Celková cena:" HorizontalAlignment="Left" VerticalAlignment="Top" RenderTransformOrigin="1.978,-1.192" Margin="10,10,0,0" FontWeight="Bold" FontSize="18"/>
        </GroupBox>
        <Label x:Name="lb_KC" Content="Kč" HorizontalAlignment="Left" VerticalAlignment="Top" RenderTransformOrigin="1.978,-1.192" Margin="708,480,0,0" FontWeight="Bold" FontSize="18" Foreground="#FFFF0C00" Grid.Column="1"/>
        <Image HorizontalAlignment="Left" Height="66" Margin="29,10,0,0" VerticalAlignment="Top" Width="68" Source="Obrazky/new.png" Grid.Column="1"/>

        <Button x:Name="bt_PridatDoSeznamu" HorizontalAlignment="Left" Margin="27,175,0,0" VerticalAlignment="Top" Width="106" RenderTransformOrigin="1.107,-1.65" Height="30" Click="bt_PridatDoSeznamu_Click" Grid.Column="1" ClickMode="Press" TextOptions.TextFormattingMode="Display" TabIndex="5">
            <Grid Width="93">
                <Image HorizontalAlignment="Left" Source="Obrazky/add.png" Margin="0,5,0,5" Width="21"/>
                <Label HorizontalAlignment="Right" Content="Přidat nové" FontWeight="Bold" Width="81" Margin="0,0,-9,0" TabIndex="10000"/>
            </Grid>
        </Button>
        <Button x:Name="bt_Upravit" HorizontalAlignment="Left" Margin="552,175,0,0" VerticalAlignment="Top" Width="80" RenderTransformOrigin="1.107,-1.65" Height="30" Click="bt_Upravit_Click" Grid.Column="1" TextOptions.TextFormattingMode="Display">
            <Grid Width="80">
                <Image HorizontalAlignment="Left" Source="Obrazky/edit.png" Margin="5,5,0,5" Width="21"/>
                <Label HorizontalAlignment="Right" Content="Upravit" FontWeight="Bold" Width="58"/>
            </Grid>
        </Button>
        <Button x:Name="bt_Smazat" HorizontalAlignment="Left" Margin="647,175,0,0" VerticalAlignment="Top" Width="89" RenderTransformOrigin="1.107,-1.65" Height="30" Click="bt_Smazat_Click" Grid.Column="1" FontWeight="Bold" TextOptions.TextFormattingMode="Display">
            <Grid Width="80">
                <Image HorizontalAlignment="Left" Source="Obrazky/delete.png" Margin="5,5,0,5" Width="21"/>
                <Label HorizontalAlignment="Right" Content="Smazat" FontWeight="Bold" Width="58"/>
            </Grid>
        </Button>
        <Label Content="Tel. číslo:" HorizontalAlignment="Left" Margin="414,120,0,0" VerticalAlignment="Top" Grid.Column="1"/>
        <TextBox x:Name="tb_tel" HorizontalAlignment="Left" Height="23" Margin="475,123,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="149" TabIndex="4" Grid.Column="1"/>
        <TextBox x:Name="tb_CelkovaCena" Grid.Column="1" HorizontalAlignment="Left" Height="30" Margin="588,484,0,0" TextWrapping="Wrap" Text="0" VerticalAlignment="Top" FontWeight="Bold" FontSize="18" Foreground="#FFFF0C00" Width="120" PreviewTextInput="tb_CelkovaCena_PreviewTextInput" TextChanged="tb_CelkovaCena_TextChanged"/>

    </Grid>
</Window>
